import { defineStore } from 'pinia';
import { ref } from 'vue';
import type { Ref } from 'vue';
import useTabsStore from '@/store/modules/tabs'




const useMenuStore = defineStore('menu', () => {
    const menuTotal = ref(0)
    function calcMenuTotal(routes) {

        menuTotal.value = (routes || []).reduce((pre, cur) => {
            return pre = cur.children ? pre + cur.children.length : pre
        }, 0)
        console.log(menuTotal.value);
    }


    return { menuTotal, calcMenuTotal }

})


export default useMenuStore